package homework.work5;

public class Main {
    public static void main(String[] args) {
        String s="woaijavawozhenaijavawozhendeaijavawozhendehenaijavaxinbuxinwoaijavagun";
        int count=0;
        int fromIndex=0;
        while ((fromIndex=s.indexOf("java",fromIndex+1))!=-1){
            count++;
        }
        System.out.println("count = " + count);
    }
}
